package 进制;

import java.awt.event.MouseAdapter;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class toHex {
    public static String toHex(int n) {
        long num=n;
        if(num<0){
            num=num+4294967296L;
        }
        Map<Integer,String> map=new HashMap<>();
        StringBuilder builder=new StringBuilder();
        map.put(10,"a");
        map.put(11,"b");
        map.put(12,"c");
        map.put(13,"d");
        map.put(14,"e");
        map.put(15,"f");
        while (num>0){
            long val=num%16;
            if(val>9){
                builder.append(map.get((int)val));
            } else {
                builder.append(String.valueOf(val));
            }
            num=num/16;
        }
        return builder.reverse().toString();

    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int num=scanner.nextInt();
            System.out.println(toHex(num));
        }
    }
}
